﻿//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - EntityName
// 1 - Properties
//===================================================================================


namespace Mangosoft.DiceCopy.Domain.MainBoundedContext.Aggregates.CoverLetterAgg {
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using Mangosoft.DiceCopy.Domain.Seedwork;

    public class CoverLetter : Entity, IValidatableObject {
        #region Members
        #endregion

        #region Constructor
        // reqired by EF
        public CoverLetter() { }

        public CoverLetter(string subject,
                string body,
                Guid jobseekerId) {
            this.Subject = subject;
            this.Body = body;
            this.JobseekerId = jobseekerId;
            this.DateCreated = DateTime.Now;
            this.LastUpdated = DateTime.Now;
        }

        #endregion

        #region Properties
        ///<summary>
        /// 
        ///</summary>
        public string Subject { get; set; }

        ///<summary>
        /// 
        ///</summary>
        public string Body { get; set; }

        ///<summary>
        /// 
        ///</summary>
        public Guid JobseekerId { get; set; }

        ///<summary>
        /// 
        ///</summary>
        public DateTime DateCreated { get; set; }

        ///<summary>
        /// 
        ///</summary>
        public DateTime LastUpdated { get; set; }


        #endregion

        #region Public Methods
        public void UpdateModifiedDate() {
            this.LastUpdated = DateTime.Now;
        }
        #endregion

        #region IValidatableObject Members
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) {
            var validationResults = new List<ValidationResult>();

            return validationResults;
        }
        #endregion
    }
}
